<?php
namespace Common\Util;
class Tree
{
	static public $treeList=array();//存放无限级分类结果
	
	public static function create($data,$pid=0)
	{
		foreach($data as $key=>$value)
		{
			if($value['pid']==$pid)
			{
				self::$treeList[]=$value;
				unset($data[$key]);
				self::create($data,$value['id']);
				//dump(self::$treeList);
				//dump($data);
				//dump($value['id']);
			}
		}
		return self::$treeList;
	}
}
?>